"""
# -*- coding: utf-8 -*-
Time    : 2025/7/28 下午4:15
Author  : Micah
File    : conftest.py
Function:
"""
import pytest
import requests


# scope = session，整个session使用一个fixture、token
# scope = function, 每个函数使用一个fixture、token
# scope = class, 每个类使用一个fixture、token
@pytest.fixture(scope='session')
def get_access_token1():
    url = 'https://api.weixin.qq.com/cgi-bin/token'
    params = {
        'grant_type': 'client_credential',
        'appid': 'wx3c56a9699553439f',
        'secret': '69696969696969696969696969696969'
    }
    r = requests.get(url, params=params)
    access_token = r.json()['access_token']
    return access_token

